#include <gtest\gtest.h>
#include "Student.h"

TEST(StudentTest, testToString) {
    Student student("Clark", "Kent", "1234", true, 100.00);
    ASSERT_EQ("\nFirst name:\t\tClark\nLast name:\t\tKent\n"
            "Student ID:\t\t1234\nTuition Amount:\t\t$0.00\n\n",
            student.toString());
}

TEST(StudentTest, testCurrencyFormat) {
    Student student("Clark", "Kent", "1234", true, 100.00);
    student.computeTuition();
    ASSERT_EQ("$0.00", student.currencyFormat(student.getTuitionAmount()));
}

TEST(StudentTest, testComputeCreditNum)
{
    Student student("Tristan", "Caruso", "1234", true, 300.00);
    Course course("Math", 3, "Monday", "1:00 PM");
    student.enrollCourse(course);
    ASSERT_EQ(3, student.computeCreditNum());
}

TEST(StudentTest, testComputeTuition) 
{
    Student student("Tristan", "Caruso", "1234", true, 300.00);
    Course course("Math", 3, "Monday", "1:00 PM");  
    student.enrollCourse(course);
    student.computeTuition();
    ASSERT_EQ(0.0, student.getTuitionAmount());
}

TEST(StudentTest, testCompareTo1) {
    Course course1("Health",2,"Monday", "8:00 AM");
    Course course2("Health",2,"Monday", "7:00 AM");
    ASSERT_TRUE(course1.compareTo(course2)>0);
}

TEST(StudentTest, testCompareTo2) {
    Course course1("Health",2,"Monday", "8:00 AM");
    Course course2("Health",2,"Tuesday", "7:00 AM");
    ASSERT_TRUE(course1.compareTo(course2)<0);
}

TEST(StudentTest, testCompareTo3) {
    Course course1("Health",2,"Monday", "8:00 AM");
    Course course2("Math",2,"Monday", "8:00 AM");
    ASSERT_TRUE(course1.compareTo(course2)<0);
}